using CMS.api.Entity;
using Microsoft.EntityFrameworkCore;

namespace CMS.api.Data
{
    public class CMSDb : DbContext
    {
        public CMSDb(DbContextOptions options) :
            base(options)
        {
        }

        public DbSet<Users> Users { get; set; }

        public DbSet<Articles> Articles { get; set; }

        public DbSet<Article_Content> Article_Content { get; set; }

        public DbSet<Article_Like> Article_Like { get; set; }

        public DbSet<Article_Low> Article_Low { get; set; }

        public DbSet<Article_Picture> Article_Picture { get; set; }

        public DbSet<Article_View> Article_View { get; set; }

        public DbSet<Article_Comment> Article_Comment { get; set; }

        public DbSet<Article_Category> Article_Category { get; set; }

        public DbSet<Administrator> Administrator { get; set; }

        public DbSet<About> About { get; set; }
        

        public DbSet<AuditInfo> AuditInfo { get; set; }

        // 配置数据库的连接(sql serve)
        protected override void OnConfiguring(
            DbContextOptionsBuilder builder
        ) =>
            builder.UseSqlServer(@"server=.;database=CMSDb;uid=sa;pwd=123456");
    }
}
